package com.lvcoding.spring5.annotation3x.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @Description 描述
 * @Date 2020-09-08 1:05 下午
 * @Author wuyanshen
 */
@Component
@Aspect
public class MyAspect {
    @Pointcut("execution(* com.lvcoding.spring5.annotation3x.aop.*.*(..))")
    public void pointcut(){}

    @Around("pointcut()")
    public Object aspect(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("--- aop方法前执行---");
        Object obj = joinPoint.proceed();
        return obj;
    }
}
